<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ page import="java.time.LocalTime" %>
<!-- jsp指令标记 -->
<%@ page import="java.time.LocalDate" %>
<!-- jsp指令标记 -->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Show time</title>
</head>
<script>
    function showtime() {
        nowtime = new Date();
        y = nowtime.getFullYear();
        mo = nowtime.getMonth() + 1;
        d = nowtime.getDate();
        h = nowtime.getHours();
        mi = nowtime.getMinutes();
        s = nowtime.getSeconds();
        mo = checkTime(mo);
        d = checkTime(d);
        mi = checkTime(mi);
        s = checkTime(s);
        document.getElementById("datetime").innerText = "JSP课设-Evanpatchouli℃-" + y + "-" + mo + "-" + d + "/" + h + ":" + mi + ":" + s;
    }

    setInterval("showtime()", 1000);

    function checkTime(i) {
        if (i < 10) {
            i = "0" + i;
        }
        return i;
    }
</script>
<body>
<div id="datetime" style="font-size:24px;font-weight:bold;text-align:center; padding-left: 90px;"></div>
</body>
</html>